import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import dao.CroRoleDao;
import entity.CroRole;
import org.apache.shiro.authc.credential.DefaultPasswordService;
import org.apache.shiro.authc.credential.PasswordService;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.print.DocFlavor;
import java.util.UUID;


/**
 * Created by xuweijie on 2017/4/20.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:/spring/spring-*.xml" )
public class testPasswordService {


    @Test
    public void paw() throws Exception {
        PasswordService service=new DefaultPasswordService();
        String str=service.encryptPassword("123456");
        System.out.println("密码:"+str);
        String uuid=UUID.randomUUID().toString().substring(0,8);
         System.out.println("uuid:"+uuid);
        String md5=new Md5Hash("123456",uuid).toString();
        System.out.println("md5:"+md5);
    }
}
